﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ALDIOrganizer
{
    public class OpenFileFormMode
    {
        public OpenFileMode SQLiteFile;
        public OpenFileMode RotasFile;
        public bool IsValid
        {
            get
            {
                if (RotasFile == OpenFileMode.ChoiceDisabled)
                {
                    return false;
                }                
                if (SQLiteFile == OpenFileMode.OnlyCreateNew
                    & (RotasFile != OpenFileMode.OnlyCreateNew))
                {
                    return false;
                }                    
                return true;
            }
        }

        public OpenFileFormMode(OpenFileMode pSQLiteFile,
            OpenFileMode pRotasFile)
        {
            SQLiteFile = pSQLiteFile;
            RotasFile = pRotasFile;
        }

        #region SQLite
        public bool SQLiteOpenEnabled
        {
            get
            {
                return SQLiteFile.OpenEnabled();
            }
        }

        public bool SQLiteCreateEnabled
        {
            get
            {
                return SQLiteFile.CreateEnabled();
            }
        }
        #endregion

        #region RotaFile
        public bool RotaFileOpenEnabled
        {
            get
            {
                return RotasFile.OpenEnabled();
            }
        }

        public bool RotaFileCreateEnabled
        {
            get
            {
                return RotasFile.CreateEnabled();
            }
        }
        #endregion
    }
}
